package Schedule::Chronic::Distributed::TaskHistory;

=head1 NAME

Schedule::Chronic::Distributed::Monitor::TaskHistory - Task History

=head1 SYNOPSIS

use Schedule::Chronic::Distributed::Monitor::TaskHistory;

=head1 DESCRIPTION

Package extending functionality of Schedule::Chronic::Distributed::Task class
providing Maypole Model action methods as well as some custom actions.

=head1 METHODS

=head2 errors

Populates the task_history/errors template for use in the Task errors report

=head2 warnings

Populates the task_history/warnings template for use in the Task warnings report

=cut

use strict;
use base qw(Maypole::Model::CDBI::Plain Schedule::Chronic::Distributed::DBI);

sub errors : Exported {
    my ($class,$r) = @_;
    my $order = $class->order($r);
    $class = $class->do_pager($r);
    $r->objects([$class->search_errors()]);
    $r->template('task_history/errors');
}

sub warnings : Exported {
    my ($class,$r) = @_;
    my $order = $class->order($r);
    $class = $class->do_pager($r);
    $r->objects([$class->search_warnings()]);
    $r->template('task_history/warnings');
}


1;


=head1 SEE ALSO

Schedule::Chronic::Distributed::Task

Schedule::Chronic::Distributed::TaskHistory

=head1 AUTHOR

aaron trevena, E<lt>aaron.trevena@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2006 by Aaron Trevena, Aviation Briefing Ltd

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.

=cut
